const files = require.context('.', true, /\.js$/)

let configRouters = []
files.keys().forEach(key => {
    if (key === './index.js') return
    configRouters = configRouters.concat(files(key).default) // 读取出文件中的default模块
})
let routers = [
    {
        path: '/',
        redirect: to => {
            return '/home';
        },
    },
    {
        path: '/home',
        name: 'Home',
        component: () => import('@/views/homeDemo.vue'),
    },
]
export default routers // 抛出一个Vue-router期待的结构的数组
